class Customer < ActiveRecord::Base
  has_many :addresses, :dependent => :destroy, :order => 'city'
  has_many :conversations, :dependent => :destroy, :order => 'contacted_on desc'
  has_many :attachments, :dependent => :destroy, :order => 'created_on desc'
  has_many :customer_tools, :dependent => :destroy
  has_many :tools, :through => :customer_tools, :order => 'company, name'
  has_many :customer_contacts, :dependent => :destroy
  has_many :contacts, :through => :customer_contacts, :conditions => "enabled = true", :order => 'last_name'
  has_many :quotes, :dependent => :destroy, :order => 'quote_number desc'
  has_many :quote_requests, :dependent => :destroy, :order => 'created_on desc'
  has_many :notes, :dependent => :destroy, :order => 'created_on desc'
  has_many :customer_tags, :dependent => :destroy
  has_many :tags, :through => :customer_tags, :order => 'name'
end